package com.gimi.cloud.bbp.dao.dao.page;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.gimi.cloud.bbp.dao.myMapper.MyMapper;
import com.gimi.cloud.bbp.dto.page.PageModelPhotoDTO;
import com.gimi.cloud.bbp.entity.page.PageModelPhoto;

@Mapper
public interface PageModelPhotoDao extends MyMapper<PageModelPhoto>{
	
	@Select("select * from pc_page_model_photo where is_delete = '0' and id= #{id}")
	PageModelPhotoDTO getPageModelPhotoById(Integer id);
	
	@Update("UPDATE pc_page_model_photo SET is_delete = '1' WHERE id in (SELECT photo_id FROM `pc_page_model` model WHERE model.id in (${modelIds}))")
	Long delByModelId(@Param("modelIds") String modelIds);

}
